package com.itheima.web;

import com.itheima.pojo.ReportData;
import com.itheima.service.ReportDataService;
import com.itheima.support.Result;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 5.报表
 */
@RestController
@RequestMapping("ReportData")
public class ReportDataCountroller {

    @DubboReference
    private ReportDataService reportDataService;
    //查询所有报表数据
    @GetMapping("/findAll")
    public Result<ReportData> findReportData(){

        return Result.build(reportDataService.findReportData());
    }
    //下载表单数据
    @GetMapping("excel")
    public Result<String> importExcel() throws Exception {

        return Result.build(reportDataService.importExcel());
    }
}
